.template-carousel {
  width: 100%;
  padding: 20px 0;
}

.template-carousel .carousel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.template-carousel .carousel-header .title-section h2 {
  font-size: 24px;
  margin: 0;
  color: #333;
}

.template-carousel .carousel-header .title-section p {
  font-size: 14px;
  color: #666;
  margin: 5px 0 0;
}

.template-carousel .carousel-header .navigation-arrows {
  display: flex;
  gap: 10px;
}

.template-carousel .carousel-header .navigation-arrows .arrow-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.template-carousel .carousel-header .navigation-arrows .arrow-btn:hover:not(.disabled) {
  background: #f5f5f5;
  border-color: #999;
}

.template-carousel .carousel-header .navigation-arrows .arrow-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.template-carousel .carousel-container {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.template-carousel .carousel-container .carousel-wrapper {
  display: flex;
  gap: 20px;
  transition: transform 0.3s ease-in-out;
}

.template-carousel .template-item {
  flex: 0 0 240px;
  border-radius: 8px;
  overflow: hidden;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.template-carousel .template-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.template-carousel .template-item .template-image-container {
  position: relative;
  width: 100%;
  height: 320px;
  overflow: hidden;
}

.template-carousel .template-item .template-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.template-carousel .template-item .template-image-container .h5-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.template-carousel .template-item .template-image-container .video-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.template-carousel .template-item .template-image-container .video-badge .play-icon {
  color: white;
  font-size: 20px;
}

.template-carousel .template-item .template-image-container .hover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.template-carousel .template-item .template-image-container .hover-overlay.active {
  opacity: 1;
}

.template-carousel .template-item .template-image-container .hover-overlay .hover-content {
  display: flex;
  gap: 10px;
}

.template-carousel .template-item .template-image-container .hover-overlay .hover-content button {
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.template-carousel .template-item .template-image-container .hover-overlay .hover-content button.preview-btn {
  background: white;
  color: #333;
}

.template-carousel .template-item .template-image-container .hover-overlay .hover-content button.preview-btn:hover {
  background: #f5f5f5;
}

.template-carousel .template-item .template-image-container .hover-overlay .hover-content button.use-btn {
  background: #1890ff;
  color: white;
}

.template-carousel .template-item .template-image-container .hover-overlay .hover-content button.use-btn:hover {
  background: #40a9ff;
}

.template-carousel .template-item .template-info {
  padding: 12px;
}

.template-carousel .template-item .template-info h3 {
  margin: 0;
  font-size: 14px;
  color: #333;
  line-height: 1.4;
  height: 40px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.template-carousel .template-item .template-info .template-meta {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #999;
}

.template-carousel .template-item .template-info .template-meta .author {
  color: #666;
}

.template-carousel .template-item.longPage .template-image-container {
  height: 400px;
}

.template-carousel .template-item.longPage .template-image-container img {
  transition: transform 0.5s ease;
}

.template-carousel .template-item.longPage .template-image-container:hover img {
  transform: translateY(-20px);
}

.template-carousel .template-item.h5 .template-image-container:hover .hover-overlay {
  opacity: 1;
}

.template-carousel .template-item.video .template-image-container:hover .video-badge {
  transform: translate(-50%, -50%) scale(1.1);
}
